{extend name="base"}
{block name="title"}后台人员角色{/block}
{block name="head"}{/block}
{block name="body"}
<body class="mainbody">
<form>
<!--导航栏-->
<div class="location">
  <a href="javascript:history.back(-1);" class="back"><i class="iconfont icon-up"></i><span>返回上一页</span></a>
  <a href="{:url('index/home')}" class="home"><i class="iconfont icon-home"></i><span>首页</span></a>
  <i class="arrow iconfont icon-arrow-right"></i>
  <span>后台人员角色</span>
</div>
<!--/导航栏-->

<div class="toolbar-wrap"></div>

<div class="table-container">
  <table class="border-table">
    <thead>
      <tr>
        <th>#</th>
        <th>角色ID</th>
        <th>角色名称</th>
        <th>关联Action数</th>
        <th>关联账号数</th>
        <th>备注说明</th>
        <th>创建时间</th>
        <th>修改时间</th>
        <th>操作 <input type="button" class="a" value="添加角色" /></th>
      </tr>
    </thead>
    <tbody>
{empty name="list"}
      <tr><td colspan="9">Oh~暂无数据!</td></tr>
{else/}
    {volist name="list" id="v"}
      <tr data-id="{$v.ID}">
        <td>{$v.ROW_NUMBER}</td>
        <td>{$v.ID}</td>
        <td>{$v.Title}</td>
        <td><a target="_blank" href="{:url('system.rbac.node/index')}?RoleID={$v.ID}">{$v.TotalNode}</a></td>
        <td><a target="_blank" href="{:url('system.rbac.user/index')}?RoleID={$v.ID}">{$v.TotalUser}</a></td>
        <td>{$v.Remark|htmlentities}</td>
        <td>{$v.CreateTime}</td>
        <td>{$v.UpdateTime}</td>
        <td>
          <input type="button" class="x" value="修改" />
          <input type="button" class="s" value="删除" />        </td>
      </tr>
    {/volist}
{/empty}
    </tbody>
  </table>
</div>

<div class="page-footer"><div class="btn-wrap">{$list->render()}</div></div>

</form>
<script>
$(function () {
  $.RoleControl.init({
    URL_DETAIL: "{:url('system.rbac.role/detail')}",
    URL_DELETE: "{:url('system.rbac.role/delete')}"
  });
  $('input.a').click(function () {  // 添加角色
    $.RoleControl.ShowDetailDialog(0);
  });
  $('input.x').click(function () {  // 修改角色
    var tr = $(this).parents('tr');
    var id = tr.data('id');
    $.RoleControl.ShowDetailDialog(id);
  });
  $('input.s').click(function () {  // 删除角色及权限
    var tr = $(this).parents('tr');
    var id = tr.data('id');
    $.RoleControl.ShowDeleteConfirm(id);
  });
});
</script>
</body>
{/block}